<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
  xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
  xmlns:drawing2="clr-namespace:OpenLS.Drawing.UI;assembly=OpenLS.Drawing.UI"
  xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals"  
  x:Class="OpenLS.Chart.UI.AreaSeriesResources"
    >
  <ResourceDictionary.MergedDictionaries>
        <chartui:ChartHelperResources/>
  </ResourceDictionary.MergedDictionaries>
  <DataTemplate DataType="{x:Type chart:AreaSeries}">
    <Grid Name="grid" chartui:SeriesElement.Series="{Binding}">

            <Polygon StrokeThickness="{Binding ShapeProperties.LineProperties.Width, FallbackValue=0}" 
               Name="polygon" Style="{x:Static chartui:ShapedObjectResources.ShapedObjectStyle}" Internals:FormatHelper.HandlesChartCommands="True">
                <Polygon.ContextMenu>
                    <ContextMenu>
                        <MenuItem Command="{x:Static chartui:ChartCommands.UnformatDataSeries}"/>
                        <MenuItem Command="{x:Static chartui:ChartCommands.AddTitle}" />
                        <MenuItem Command="{x:Static chartui:ChartCommands.AddLegend}" />
                        <MenuItem Command="{x:Static chartui:ChartCommands.AddDataLabels}"/>
                        <MenuItem Command="{x:Static chartui:ChartCommands.FormatDataLabels}"/>
                        <MenuItem Command="{x:Static chartui:ChartCommands.FormatDataSeries}"/>
                    </ContextMenu>
                </Polygon.ContextMenu>
                <Polygon.Points>
                    <MultiBinding Converter="{x:Static  Internals:ChartConverters.AreaSeriesToPointsConverter}">
                        <Binding/>
                        <Binding Path="(chartui:ChartElement.Chart)" RelativeSource="{RelativeSource Self}"/>
                        <Binding Path="ActualWidth" ElementName="grid"/>
                        <Binding Path="ActualHeight" ElementName="grid"/>
                        <Binding Path="(chartui:ChartElement.YAxisInfo).Minimum" RelativeSource="{RelativeSource Self}"/>
                        <Binding Path="(chartui:ChartElement.YAxisInfo).Maximum" RelativeSource="{RelativeSource Self}"/>
                        <Binding Path="(chartui:ChartElement.Chart).VerticalAxis.Orientation" RelativeSource="{RelativeSource Self}"/>
                        <Binding Path="(chartui:ChartElement.Chart).HorizontalAxis.Orientation" RelativeSource="{RelativeSource Self}"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:ChartElement.Observer).Generation"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:ChartElement.Observer).MaxIndex"/>
                    </MultiBinding>
                </Polygon.Points>
            </Polygon>
        </Grid>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding Path=ShapeProperties.FillProperties}" Value="{x:Null}">
        <Setter Property ="Fill" TargetName="polygon">
          <Setter.Value>
            <MultiBinding Converter="{x:Static Internals:ChartConverters.PatternConverter}">
              <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:ChartElement.Style)"/>
              <Binding Path="Index"/>
              <Binding RelativeSource="{RelativeSource Self}" Path="(drawing2:DrawingElement.Theme).ColorScheme"/>
              <Binding Source="debug3"/>
            </MultiBinding>
          </Setter.Value>
        </Setter>
      </DataTrigger>
      <DataTrigger Binding="{Binding ShapeProperties}" Value="{x:Null}">
        <Setter Property ="Fill" TargetName="polygon">
          <Setter.Value>
            <MultiBinding Converter="{x:Static Internals:ChartConverters.PatternConverter}">
              <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:ChartElement.Style)"/>
              <Binding Path="Index"/>
              <Binding RelativeSource="{RelativeSource Self}" Path="(drawing2:DrawingElement.Theme).ColorScheme"/>
              <Binding Source="debug4"/>
            </MultiBinding>
          </Setter.Value>
        </Setter>
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

</ResourceDictionary>